package cn.itcast.bos.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import cn.itcast.bos.domain.base.Standard;

@Repository
public interface StandardRepository extends JpaRepository<Standard,Integer>{
	
	//表示按照名称查询数据库   格式  find + By + 实体类的属性名称
	public List<Standard> findByName(String name);

	//表示按照名称模糊查询数据库   格式  find + By + 实体类的属性名称 +Like
	public List<Standard> findByNameLike(String string);
	
	@Query(value="from Standard where name=?",nativeQuery=false)
	public List<Standard> queryName(String string);


	public List<Standard> queryName2(String string);
	
	@Query(value="update Standard set minLength=?2 where id =?1")
	@Modifying
	public void updateMinLength(Integer id , Integer minLength);
}
